package date;
class Date1{
    public int year;
    public int month;
    public int day;
    public void printDate(){
        System.out.println("今天是 "+year+"年 "+month+" 月"+day+" 日");
    }
//    public void setDate(int year,int month,int day ){
//        this.year=year;
//        this.month=month;
//        this.day=day;
//    }
    public Date1(int year,int month,int day ){
        this.year=year;
        this.month=month;
        this.day=day;
        System.out.println("调用了带有三个参数的构造方法");
    }
    public Date1(){
        year=2010;
        month=11;
        day=25;
        System.out.println("调用了无参的构造方法");
    }
}
public class 日期2 {
    public static void main(String[] args) {
        Date1 date1=new Date1(2008,9,20);
        date1.printDate();
        Date1 date2 =new Date1();
        date2.printDate();
    }
}

